package com.feicheng.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.feicheng.entity.PurchaseHeader;
import com.feicheng.model.PurchaseHeaderWithUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hao.zhang
 * @since 2022-07-04
 */
@Mapper
public interface PurchaseHeaderMapper extends BaseMapper<PurchaseHeader> {

    /**
     * <p>
     *  Mapper 接口
     * </p>
     *
     * @author feng.zhang
     * @since 2022-07-04
     */
    Page<PurchaseHeaderWithUser> selectPurchaseHeader(
            Page<PurchaseHeaderWithUser> page,
            @Param(Constants.WRAPPER) Wrapper wrapper);

    /**
     * <p>
     *  Mapper 接口
     * </p>
     *
     * @author clin.song
     * @since 2022-07-06
     */
    PurchaseHeaderWithUser selectPurchaseHeaderWithUser(
            @Param(Constants.WRAPPER) Wrapper wrapper);

    /**
     * <p>
     *  Mapper 接口
     * </p>
     *
     * @author huanning.lu
     * @since 2022-07-07
     */
    @Select("select state from purchase_header where purchase_header_id = #{purchaseHeaderId}")
    String byId(Integer purchaseHeaderId);
}
